/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 应用容器 */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-item {
    display: block;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #fff;
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-left-color: #fff;
}

.nav-item i {
    margin-right: 10px;
    width: 16px;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 0;
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 工具栏 */
.toolbar {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.toolbar h2 {
    color: #2c3e50;
    font-weight: 600;
}

.toolbar-right {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 视图内容 */
/* 视图内容区域 */
.view-content {
    display: none;
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

.view-content.active {
    display: block;
}

/* 任务输入区域 */
.task-input-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.task-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.task-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 任务列表容器 */
.task-list-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-item {
    padding: 20px 25px;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.3s ease;
}

.task-item:hover {
    background-color: #f8f9fa;
}

.task-item:last-child {
    border-bottom: none;
}

.task-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.task-text {
    font-size: 16px;
    color: #2c3e50;
}

.task-text.completed {
    text-decoration: line-through;
    color: #6c757d;
}

.task-date {
    font-size: 14px;
    color: #6c757d;
    background-color: #e9ecef;
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

/* 优先级标识样式 */
.priority-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 16px;
    margin-left: 8px;
    text-align: center;
    min-width: 40px;
    display: inline-block;
}

.priority-high {
    background-color: #ff4757;
    color: white;
}

.priority-medium {
    background-color: #ffa502;
    color: white;
}

.priority-low {
    background-color: #2ed573;
    color: white;
}

/* 优先级选择器样式优化 */
.priority-select {
    padding: 10px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    margin-right: 10px;
}

.priority-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.priority-select:hover {
    border-color: #bdc3c7;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.task-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
}

/* 进度输入控件样式 */
.progress-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 10px;
}

.progress-input-group label {
    font-size: 14px;
    color: #495057;
    white-space: nowrap;
}

/* 进度滑块容器 */
.progress-slider-container {
    position: relative;
    width: 100px;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    overflow: hidden;
}

.progress-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    z-index: 2;
    cursor: pointer;
}

.progress-slider-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #87ceeb;
    border-radius: 3px;
    transition: width 0.2s ease;
    pointer-events: none;
}

.progress-slider::-webkit-slider-track {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: transparent;
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 3;
}

.progress-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: transparent;
    border: none;
}

.progress-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* 禁用状态的进度滑块样式 */
.progress-slider:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.progress-slider:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
    background: #ccc;
}

.progress-slider:disabled::-moz-range-thumb {
    cursor: not-allowed;
    background: #ccc;
}

.progress-slider:disabled + .progress-slider-fill {
    opacity: 0.6;
}

.progress-slider::-moz-range-progress {
    height: 6px;
    border-radius: 3px;
    background: #87ceeb;
}

.progress-value {
    font-size: 12px;
    color: #6c757d;
    min-width: 35px;
    text-align: center;
}

/* 任务进度条样式 */
.task-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.progress-bar-container {
    flex: 1;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    min-width: 80px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 50%, #007bff 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: #6c757d;
    min-width: 35px;
    text-align: center;
    font-weight: 500;
}

/* 响应式设计 - 进度相关 */
@media (max-width: 768px) {
    .progress-input-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin: 8px 0;
    }
    
    .progress-slider-container {
        width: 80px;
    }
    
    .task-progress {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .progress-bar-container {
        width: 100%;
        min-width: unset;
    }
}

/* 筛选区域 */
.filter-section {
    background: white;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.date-range-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.priority-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.date-range-filter label,
.priority-filter label {
    font-weight: 500;
    color: #2c3e50;
    min-width: 60px;
}

.date-input {
    padding: 8px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
}

/* 大屏幕优化 - 将筛选条件排列在一行 */
@media (min-width: 1200px) {
    .filter-section {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 30px;
        flex-wrap: wrap;
    }
    
    .date-range-filter {
        margin-bottom: 0;
        flex: 1;
        min-width: 400px;
    }
    
    .priority-filter {
        flex: 1;
        min-width: 350px;
        justify-content: flex-end;
    }
}

/* 日历视图 */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: white;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.calendar-header h3 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.calendar-day {
    aspect-ratio: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 8px;
    background: white;
    border: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
    min-height: 80px;
}

.calendar-day:hover {
    background-color: #f8f9fa;
}

.calendar-day.selected {
    background-color: #667eea;
    color: white;
}

.calendar-day.other-month {
    color: #ccc;
    background-color: #f8f9fa;
}

.calendar-day.today {
    background-color: #e3f2fd;
    font-weight: bold;
}

.calendar-day-number {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.calendar-task-count {
    font-size: 12px;
    background-color: #667eea;
    color: white;
    border-radius: 12px;
    padding: 4px 8px;
    min-width: 20px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.selected-date-tasks {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.selected-date-tasks h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* 设置页面 */
.settings-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.settings-section h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.3rem;
}

.setting-item {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f3f4;
}

.setting-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.setting-desc {
    margin-top: 8px;
    color: #6c757d;
    font-size: 14px;
}

/* 分页控件 */
/* 分页样式 */
.pagination-container {
    height: 60px;
    background: white;
    border-top: 1px solid #e1e8ed;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 30px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.pagination-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: white;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    font-size: 12px;
}

.pagination-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pagination-btn:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
}

.pagination-info {
    padding: 0 8px;
    font-size: 12px;
    color: #495057;
    font-weight: 500;
    white-space: nowrap;
}

#page-info {
    color: inherit;
    font-size: inherit;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e1e8ed;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #495057;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        height: 100vh;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .toolbar-right {
        justify-content: center;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .task-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .task-actions {
        justify-content: center;
    }
    
    .date-range-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 2px;
    }
    
    .calendar-day {
        padding: 8px 4px;
        font-size: 12px;
        min-height: 60px;
    }
    
    .calendar-day-number {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .calendar-task-count {
        font-size: 10px;
        padding: 3px 6px;
        min-width: 18px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    /* 分页响应式优化 */
    .pagination-container {
        height: 60px;
    }
    
    .pagination {
        padding: 4px 8px;
        gap: 6px;
    }
    
    .pagination-btn {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    
    .pagination-info {
        padding: 0 6px;
        font-size: 11px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 成功提示 */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

/* 错误提示 */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 回收站特殊样式 */
.trash-task-item {
    /* 保持与普通任务项相同的基础样式 */
}

.trash-task-item .task-text {
    color: #7f8c8d; /* 稍微暗一些表示已删除状态 */
}

.deleted-date {
    font-size: 12px;
    color: #6c757d;
    background-color: #e9ecef;
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

/* 回收站按钮样式优化 */
.trash-task-item .task-actions {
    gap: 8px; /* 与普通任务项保持一致 */
}

.trash-task-item .task-actions .btn {
    padding: 6px 10px; /* 与普通任务项保持一致 */
    font-size: 12px; /* 与普通任务项保持一致 */
}

/* 回收站空状态样式优化 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-state i {
    font-size: 48px;
    color: #bdc3c7;
    margin-bottom: 20px;
    display: block;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #5d6d7e;
}

.empty-state p {
    font-size: 14px;
    color: #95a5a6;
}

/* 回收站为空消息样式 */
.empty-trash-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    min-height: 300px;
}

.empty-trash-message i {
    font-size: 48px;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.empty-trash-message p {
    font-size: 16px;
    color: #5d6d7e;
    margin: 0;
}

/* 回收站视图容器样式 */
#trash-view .task-list-container {
    /* 使用与其他视图相同的样式 */
}

.task-actions {
    display: flex;
    gap: 8px;
}

.task-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
}